//@author A0096466N
//
// **********
//
// logic class is the main processing class
// that takes in the user strings inputs from UI 
// and returns any information required by UI
//
// **********

#ifndef LOGIC_H
#define LOGIC_H

#include "Add.h"
#include "AutoEditStatus.h"
#include "Clash.h"
#include "Delete.h"
#include "Display.h"
#include "Event.h"
#include "Filter.h"
#include "Help.h"
#include "History.h"
#include "Mark.h"
#include "Modify.h"
#include "Parser.h"
#include "Reminder.h"
#include "Redo.h"
#include "Reset.h"
#include "Sorter.h"
#include "Searcher.h"
#include "Storage.h"
#include "Undo.h"

class Logic {
 
private:

		Event _userEvent;
		Help _help;
		History _history;
		Parser _parse;
		Storage _storage;
		string _userInput;
		
		// contains a copy of all tasks
		vector <Task> _store; 
        
		// contains the tasks of the most recent display
		vector <Task> _forUIDisplay;

		// contains the various information for the most recent display
		vector <string> _forUICalendar;
		vector <string> _forUITaskName;
		vector <string> _forUIDeadline;
		vector <string> _forUIPriority;
		vector <string> _forUITime;
		vector <string> _forUIStatus;
		string _forUIFeedback;
		string _forUIWarning;
		string _sortType;
		bool _tickOrCross;

		// contains information for F1 help in UI
		vector <string> _forUIHelp;
		
		void addTask();
        void autoEditStatus();
        void clearUserEvent();
		void clearForUI();
		void deleteTask();
        void display();
        void executeCommand();
        void filter();
        void identifyClash();
		void invalidCommand();
		void mark();
		void modify();
        void printList();
		void redo();
		void reminder();
		void reset();
       	void search();
        void sort();
		void sortList();
		void undo();
		void updateUICalendar();
		
public:
        Logic(void);
        ~Logic(void);
 
		void start(string);
		vector <string> getForUITaskName();
		vector <string> getForUIDeadline();
		vector <string> getForUIPriority();
		vector <string> getForUITime();
		vector <string> getForUIStatus();
        vector <string> getForUICalendar();
		vector <string> getForUIHelp();
		string getForUIFeedback();
		string getForUIWarning();
		bool getTickOrCross();

		// for unit testing
		vector <Task> getForUIDisplay();		
};
  
#endif 
